// FILE: main.js

import { createApp } from 'vue'
import { Quasar, Dialog } from 'quasar'
import quasarLang from 'quasar/lang/zh-CN'

// Import icon libraries
import '@quasar/extras/material-icons/material-icons.css'

// Import Quasar css
import 'quasar/dist/quasar.css'

// Assumes your root component is App.vue
// and placed in same folder as main.js
import App from './App.vue'
import {sessionGet, sessionSet} from "dlsjs";

const myApp = createApp(App)

myApp.use(Quasar, {
  plugins: {
    Dialog
  }, // import Quasar plugins and add here
  lang: quasarLang,
  /*
  config: {
    brand: {
      // primary: '#e46262',
      // ... or all other brand colors
    },
    notify: {...}, // default set of options for Notify Quasar plugin
    loading: {...}, // default set of options for Loading Quasar plugin
    loadingBar: { ... }, // settings for LoadingBar Quasar plugin
    // ..and many more (check Installation card on each Quasar component/directive/plugin)
  }
  */
})
myApp.directive('drag', {
  mounted: (el, binding) => {
    el.setAttribute('draggable', true)
    el.dragData = binding.value
    el.addEventListener('dragstart', function (event) {
      event.stopPropagation()
      // @ts-ignore
      el.dragData.layerX = event.layerX
      // @ts-ignore
      el.dragData.layerY = event.layerY
      sessionSet('drag', el.dragData)
    })
  },
  updated: (el, binding) => {
    el.dragData = binding.value
  },
})


import {createNovue} from '../core/index.js'
// import {createNovue} from '../dist/novue.js'
import '../dist/style.css'
import tag from './js/tag.config.js'
import func from './js/func.config.js'
import usage from './js/usage.config.js'

const novue = createNovue({
  tags: tag,
  func: func,
  usage: usage
})

myApp.use(novue)
// Assumes you have a <div id="app"></div> in your index.html
myApp.mount('#app')

